package net.wofly.sale.activity.service.impl;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import net.wofly.sale.activity.repository.ActivityGiftRepository;
import net.wofly.sale.activity.domain.ActivityGift;
import net.wofly.sale.activity.service.IActivityGiftService;

@Service("iActivityGiftService")
@Transactional
public class ActivityGiftServiceImpl implements IActivityGiftService {

	@Autowired
	ActivityGiftRepository activityGiftRepository;

	@Override
	public ActivityGift save(ActivityGift entity) {
		return activityGiftRepository.save(entity);
	}

	@Override
	public void delete(ActivityGift entity) {
		activityGiftRepository.delete(entity);
	}

	@Override
	public void delete(String key) {
		activityGiftRepository.delete(key);
	}

	@Override
	public ActivityGift findOne(String key) {
		return activityGiftRepository.findOne(key);
	}

	@Override
	public List<ActivityGift> save(List<ActivityGift> entityList) {
		return (List<ActivityGift>) activityGiftRepository.save(entityList);
	}
	
	@Override
	public List<ActivityGift> findByActivityID(String activityID) {
		return activityGiftRepository.findByActivityID(activityID);
	}
	
	@Override
	public void deleteByActivityID(String activityID) {
		activityGiftRepository.deleteByActivityID(activityID);
	}
}
